package com.appkubes.mall.admin.application.system.ad.dao;

import com.appkubes.mall.core.dao.BaseMallAdDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface AdDao extends BaseMallAdDao {


    @Update({"<script>",
            "update mall_ad set state=1 where ad_key in ",
            "<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'> #{id} </foreach> ",
            "</script>"})
    int batchenable(@Param("ids") String[] ids);

    @Update({"<script>",
            "update mall_ad set state=0 where ad_key in ",
            "<foreach item='id' index='index' collection='ids' open='(' separator=',' close=')'> #{id} </foreach> ",
            "</script>"})
    int batchunenable(@Param("ids") String[] ids);


}
